
// Copyright (C) 2011-2012 Luca Piccioni
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//  
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//  
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

using System.Collections.Generic;

namespace Derm.Scene
{
	/// <summary>
	/// Directed graph node interface.
	/// </summary>
	public interface IDirectedGraphNode<T> where T : IDirectedGraphNode<T>
	{
		#region Parent Link Management

		/// <summary>
		/// This IDirectedGraphNode parent.
		/// </summary>
		T Parent { get; }

		#endregion

		#region Child Links Management

		/// <summary>
		/// Number of links starting from this IDirectedGraphNode.
		/// </summary>
		uint LinkCount { get; }

		/// <summary>
		/// Create a link between this IDirectedGraphNode and another IDirectedGraphNode.
		/// </summary>
		/// <param name="node">
		/// Node to link as child of this DirectedGraphNode.
		/// </param>
		void Link(T node);

		/// <summary>
		/// Delete the link between this DirectedGraphNode and another DirectedGraphNode.
		/// </summary>
		/// <param name="node">Node to unlink src child of this DirectedGraphNode.</param>
		void Unlink(T node);

		/// <summary>
		/// Enumeration of IDirectedGraphNode linking by this IDirectedGraphNode.
		/// </summary>
		IEnumerable<T> Children { get; }

		#endregion
	}
}